package com.tdam2011.grupo06;

import android.os.Bundle;
import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TabHost;

public class RegistroAcciones extends TabActivity {
	
	private TabHost _tabHost;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_registro_acciones);
        
        Resources res = getResources();
        
        _tabHost = getTabHost();
        TabHost.TabSpec spec;
        Intent intent;
        
        //Primer Tab
        intent = new Intent(this, ListaAccionesLlamadas.class);
        spec = _tabHost.newTabSpec("llamadas")
        		.setIndicator("",res.getDrawable(R.drawable.ic_call))
        		.setContent(intent);
        
        _tabHost.addTab(spec);
        
        //Segundo Tab
        intent = new Intent(this, ListaAccionesSMS.class);
        spec = _tabHost.newTabSpec("sms")
        		.setIndicator("", res.getDrawable(R.drawable.ic_sms))
        		.setContent(intent);
        
        _tabHost.addTab(spec);
        
        //Tercer Tab
        intent = new Intent(this, ListaAccionesMail.class);
        spec = _tabHost.newTabSpec("mail")
        		.setIndicator("", res.getDrawable(R.drawable.ic_email))
        		.setContent(intent);
        
        _tabHost.addTab(spec);
        
        
        //Cuarto Tab
        intent = new Intent(this, ListaAccionesWebService.class);
        spec = _tabHost.newTabSpec("web_service")
        		.setIndicator("", res.getDrawable(R.drawable.ic_webmail))
        		.setContent(intent);
        
        _tabHost.addTab(spec);              
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_registro_acciones, menu);
        return true;
    }
   
    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case R.id.menu_settings:     
            	Intent intent = new Intent(RegistroAcciones.this,
               	      PreferenciasRegistro.class);
               	      startActivity(intent);
            break;
        }
        return true;
    }
}
